import  React from 'react';
import { BrowserRouter as Router,withRouter,RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'
// import createBrowserHistory from 'history/createBrowserHistory';

//延时加载
let Home = React.lazy(() => import('../pages/home/index'));

//加载的过渡动画
let Loading =()=>{
  return (
    <div>{/* loading */}</div>
  )
}

class RouterMap extends React.Component {
  render() {
    return (
      // <Router basename="/blog">
      <Router>
        <Switch>
            <React.Suspense fallback={<Loading/>}>
              <Route exact path="/" component={Home} />
            </React.Suspense>
        </Switch>
      </Router>
    );
  }
}

//返回了 connect 其实是一个容器组件
export default RouterMap; 
